<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name,age){
            this.name = name
            this.age = age
        }
        Person.prototype = {
            constructor:Person,  // 重置 constructor
            sayName:function(){
                console.log(this.name);
            },
            sayAge(){
                console.log(this.age);
            }
        }
        
        var p = new Person("cheng",20)
        console.log(p.constructor); // Person
        console.log(p.constructor == Person);  // true
        console.log(p instanceof Person); 
    </script> 
</body>
</html>